package com.zzr.demo.redis.controller;

import com.zzr.demo.redis.service.BlockMQService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: xiaomi
 * @date: 2021/10/8
 * @description:
 */
@RestController
@RequestMapping("block/mq")
@Api(tags = "阻塞队列：消费者阻塞等待")
@Slf4j
public class BlockMQController {

    @Autowired
    BlockMQService blockMQService;

    @GetMapping("/addMessage/{message}")
    @ApiOperation("添加消息")
    public boolean addMessage(@PathVariable("message") String message) {
        boolean b = blockMQService.addMessage(message);
        return b;
    }
}
